<template>
  <div class="realAuthen">
    <div class="seller" v-if="!userInfo.user_realName">
      <div class="seller_top">
        <i class="iconfont icon-grin-squint-tears" /> 
        <span>您还没有实名认证,点击下方立即进行实名认证</span>
      </div>
      <el-button type="primary" @click="()=>{handleAuthen(true)}"><i class="iconfont icon-add" />实名认证</el-button>
    </div>
    <div class="yourRealInfo" v-else>
       <p>您的实名制信息</p>
       <div class="item">
         <span>姓名: </span> 
         <span>{{userInfo.user_realName}}</span>
        </div>
       <div class="item">
         <span>身份证: </span> 
         <span>{{userInfo.user_idNumber}}</span>
        </div>
        <div class="item">
         <span>银行卡: </span> 
         <span>{{userInfo.user_bankCard}}</span>
        </div>
    </div>
    <realAuthenModal :visible="realVisible" @close="()=>{handleAuthen(false)}"/>
  </div>
</template>

<script>
import { mapState } from 'vuex';
import realAuthenModal from './realAuthenModal.vue'

export default {
  name:'' ,
  components: {
    realAuthenModal
  },
  computed: {
    ...mapState({
      userInfo: state => state.user.userInfo
    })
  },
  data() {
  return {
    realVisible: false
  };
  },
  methods: {
    handleAuthen(realVisible){
      this.realVisible = realVisible;
    }
  },
}
</script>
<style lang='scss' scoped src="./index.scss" />
